package com.requiem.hist_group_manage_springboot.controller;

import com.requiem.hist_group_manage_springboot.exception.R;
import com.requiem.hist_group_manage_springboot.model.BlackModel;
import com.requiem.hist_group_manage_springboot.service.BlackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/black")
public class BlackController {
    @Autowired
    BlackService blackService;

    @GetMapping("/getList")
    R getList() {
        return blackService.getList();
    }

    @PostMapping("/add")
    R add(@RequestBody BlackModel blackModel) {
        return blackService.add(blackModel);
    }

    @DeleteMapping("/delete")
    R delete() {
        return blackService.delete();
    }

    @PostMapping("/Search")
    R getSearch(@RequestBody BlackModel blackModel) {
        return blackService.SearchList(blackModel);
    }
}
